<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of LoginForm
 *
 * @author julien
 */
require_once 'Classes/View/ViewItems/ComposedViewItem.php';
require_once 'Classes/View/ViewItems/FormItem.php';
require_once 'Classes/View/ViewItems/TextFieldItem.php';

class LoginForm  extends ComposedViewItem {
    
    private $form;
    private $message;
    
    public function __construct($actionPage=null,$message="You have to login"){
       
        parent::__construct();

        $this->form = new FormItem($actionPage,"post","Logins",true);
        $this->message=new TextFieldItem($message);
        $this->message->addEndingSpace();
        
        $this->setClass("content");
        $this->form->addInputField("login","text");
        $this->form->addInputField("password","password");
        $this->addElement($this->message);
        $this->addElement($this->form);
    }
    
    public function setMessage($text){
        $this->message->setText($text);
    }
    
  
}

?>
